package org.example.projecttwo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 消息表
 * </p>
 *
 * @author nn
 * @since 2025-11-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("message")
@Schema(name="Message对象", description="消息表")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID（雪花算法）")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "消息编号")
    @TableField("message_no")
    private String messageNo;

    @Schema(description = "通知形式")
    @TableField("notice_type")
    private Integer noticeType;

    @Schema(description = "消息正文")
    @TableField("content")
    private String content;

    @Schema(description = "图片地址")
    @TableField("cover_url")
    private String coverUrl;

    @Schema(description = "发布者ID")
    @TableField("publisher_id")
    private Long publisherId;

    @Schema(description = "发布者角色")
    @TableField("publisher_role")
    private Integer publisherRole;

    @Schema(description = "接收范围")
    @TableField("target_scope")
    private Integer targetScope;

    @Schema(description = "过期时间")
    @TableField("expire_time")
    private LocalDateTime expireTime;

    @Schema(description = "状态")
    @TableField("status")
    private Integer status = 0;

    @Schema(description = "发布时间")
    @TableField("publish_time")
    private LocalDateTime publishTime;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "最后更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}